/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 姚东名
 * Date: 2024-07-02
 * Time: 11:57
 */
public class Student {
    private String name;//姓名
    private int age;//年龄
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }
    public String getName() {
        return this.name;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public int getAge() {
        return age;
    }
    @Override
    public String toString() {
        return "Student{" + "'name=" + name + '\'' + " age=" + age + '}';
    }
//[Student{name='张三', age=10}, Student{name='李四', age=20}, Student{name='王五', age=30}]
    /*@Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }*/
}
